﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Windows;

namespace Valentia.Kinection.Configuration.Manager
{
    static class Program
    {
        public static readonly String ApplicationName = "Kinection Service Configuration";

        ///// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            ////xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            ////xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            //System.Windows.Application a = new System.Windows.Application();
            //a.StartupUri = new Uri("MainWindow.xaml", UriKind.Relative);
            //a.Run();

            bool lockAquired = false;
            using (System.Threading.Mutex objThread = new System.Threading.Mutex(true, "1e0e6266-e679-44e1-99c6-0708b544f225", out lockAquired))
            {
                if (!lockAquired)
                {
                    MessageBox.Show(
                        "Valentia Kinection Service Config. Manager is already running", Program.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                System.Windows.Forms.Application.EnableVisualStyles();
                System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
                System.Windows.Forms.Application.Run(new frmConfigManager());
            }
        }
    }

    public class GridRecordDoubleClickedArgs : EventArgs
    {
        public Object RecordObject { get; private set; }
        public GridRecordDoubleClickedArgs(Object recordObject) { this.RecordObject = recordObject; }
    }

    public class GridDispalyColumnInfo
    {
        public String DataPropertyName { get; private set; }
        public String HeaderText { get; private set; }

        public GridDispalyColumnInfo(String dataPropertyName, String headerText)
        {
            this.DataPropertyName = dataPropertyName;
            this.HeaderText = headerText;
        }
    }
}
